a lock will not keep out an absolutely determined intruder with unlimited resources, skills, knowledge and time.
However, even a minimal lock can delay a typical intruder for a time, and the disturbance generated in circumventing a high-quality lock, for example by breaking windows or doors, can deter many attackers, causing them to direct their attacks against weaker targets.